package com.whmw.mybatisplusdemo.pojo;

import com.baomidou.mybatisplus.annotation.*;
import com.whmw.mybatisplusdemo.enums.GenderEnum;
import com.whmw.mybatisplusdemo.enums.StatusEnum;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * @author 陈秋雨
 * @since 2025/07/12 下午 11:21
 */
@Data
@TableName(value = "`user`")
public class User {
    @TableId(type = IdType.AUTO)
    private Integer id;
    private String name;
    private Integer age;
    private String email;

    private GenderEnum gender;
    private StatusEnum status;

    @TableField(fill = FieldFill.INSERT)  //插入时自动填充
    private LocalDateTime createTime;

    @TableField(fill = FieldFill.INSERT_UPDATE)  //插入和更新时自动填充
    private LocalDateTime updateTime;

    @TableField(fill = FieldFill.INSERT)  //插入时自动填充
    private Long createUser;

    @TableField(fill = FieldFill.INSERT_UPDATE)  //插入和更新时自动填充
    private Long updateUser;

    @TableLogic(value = "0", delval = "1")
    private Integer deleted;
    @Version
    private Integer version;
}
